<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%--
  Created by IntelliJ IDEA.
  User: zhangyiyi
  Date: 2025/3/3
  Time: 9:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    List name=new ArrayList();
    name.add("Tom");
    name.add("kitty");
    name.add("张山");
    request.setAttribute("name",name);
%>
输出List集合中的元素（姓名）：<br>
<c:forEach items="${name}" begin="0" end="2" step="1" var="n">
    ${n}<br>
</c:forEach>
</body>
</html>
